<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;}
        div{position: absolute;width: 20px;height: 20px;border-radius: 50%;background: red;}
    </style>
    <script>
        window.onload = function(){
            var oDiv = document.getElementsByTagName('div');
            document.onmousemove = function(ev){
                var e = ev||window.event;
                for(var i = oDiv.length -1 ;i>0;i--){
                    oDiv[i].style.left = oDiv[i-1].offsetLeft + 'px';
                    oDiv[i].style.top = oDiv[i-1].offsetTop + 'px';
                }
                oDiv[0].style.left = e.clientX + 'px';
                oDiv[0].style.top = e.clientY + 'px';
            }
        }
    </script>
</head>
<body>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
</body>
</html>